function sendThis(params) {
	sendRequest("bugcontrol.php",params);
}

function sendThisWait(params) {
	sendRequest("bugcontrol.php",params, false);
}

function checkEmpty(ele, text) {
	if (trim(ele.value)=="") {
		alert("El campo "+text+" es requerido");
		return false;
	}
	return true;
}

function sendAdd(form, ele, text) {
	var obj = document.forms[form][ele];
	if (checkEmpty(obj, text)) {
    	var params = "action=add&idadd="+obj.value;
		sendThis(params);
	}
}

function sendSearch(form, ele, text) {
	var obj = document.forms[form][ele];
    if (checkEmpty(obj, text)) {
        var params = "action=searchall&busca="+obj.value;
		sendThis(params);
    }
}

function sendGoto(form, ele, text) {
	var obj = document.forms[form][ele];
    if (checkEmpty(obj, text)) {
        var params = "id="+obj.value;
		sendThis(params);
    }
}

